<?php
set_time_limit(0);
define('IN_WT', true);
include 'include.php';
include 'config.php';
$feed = 'http://hax.javaeye.com/rss';
$db = mysqlDB::con();
$RSS = wt_xml::readRSS($feed);
$BID = wt_xml::getBlogID($feed);
$i = 0;
if (!empty($RSS['post']))
{
	foreach (array_reverse($RSS['post']) as $v)
	{
		if (wt_xml::getLastUpdate($feed) < strtotime($v['pubDate']))
		{
			$i ++;
			echo '.';
			wt_xml::addPost($v, $BID);
		}
	}
	if ($i > 0)
	{
		echo 'ds';
		wt_post::clearCache($BID);
		wt_post::creatCache($BID);
	}
}

/*define('IN_WT', true);
include 'include.php';
include 'config.php';


$sql = 'SELECT `BID` FROM `blog_info`';
$db = mysqlDB::con();

$bid = $db->getOneArr($sql);
foreach ($bid as $v)
{
	$sql = 'SELECT COUNT(`Pid`) AS n FROM `post_into` WHERE `BID` = ' . $v;
	$num = $db->query2one($sql);
	echo $num . "\n";
	$sql = 'UPDATE `blog_info` SET `countNUM`=\'' . $num . '\' WHERE (`BID`=\''  . $v . '\')';
	$db->query($sql);
}

*/